package com.longge;

public class MinDeletionSize {

    public int minDeletionSize(String[] strs) {

        int res = 0;
        int[][] ints = new int[strs.length][strs[0].length()];
        for (int i = 0; i < strs.length; i++) {
            for (int j = 0; j < strs[i].length(); j++) {
                ints[i][j] = strs[i].charAt(j);
            }
        }
        for (int j = 0; j < ints[0].length; j++) {
            for (int i = 1; i < ints.length; i++) {
                if (ints[i-1][j]>ints[i][j]) {
                    res++;
                    break;
                }
            }
        }
        return res;
    }
}
